package teach.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import teach.aistar.mapper.CarCartMapper;
import teach.aistar.model.entity.CarCart;
import teach.aistar.service.ICarCartService;

import java.util.List;

@Service
public class CarCartServiceImpl implements ICarCartService {

    @Autowired
    CarCartMapper cartCartMapper;


    @Override
    public List<CarCart> selectAll() {


        return  cartCartMapper.selectAll();


    }

    @Override
    public int  addCart(CarCart cart) {
         return cartCartMapper.saveCard(cart);
    }

    @Override
    public List<CarCart> selectUid(Integer Uid) {
        return cartCartMapper.findAll(Uid);
    }

    @Override
    public int deleteById(Integer id) {
        return cartCartMapper.deleteById(id);
    }

    @Override
    public int updates(Integer id, Integer counts) {
        return cartCartMapper.updates(id,counts);
    }
}
